home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir31 / snrc21h.zip / SONARC.DOC < prev    next >
Text File  |  1994-06-19  |  31KB  |  670 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.     SSSSSSS       OOOOO     N         N       A       RRRRRRR        CCCCCC
  11.    S       S     O     O    NN        N      A A      R      RR     C      C
  12.   S         S   O       O   N N       N     A   A     R        R   C        C
  13.   S            O         O  N  N      N    A     A    R        R  C
  14.    SSS         O         O  N   N     N   A       A   R      RR   C
  15.       SSS      O         O  N    N    N  A         A  RRRRRRR     C
  16.          SSS   O         O  N     N   N  AAAAAAAAAAA  R   R       C
  17.             S  O         O  N      N  N  A         A  R    R      C
  18.   S         S   O       O   N       N N  A         A  R     R      C        C
  19.    S       S     O     O    N        NN  A         A  R      R      C      C
  20.     SSSSSSS       OOOOO     N         N  A         A  R       R      CCCCCC
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                 SONARC: Digital Audio Compression, Version 2.1h
  29.                 ───────────────────────────────────────────────
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                      (C) Copyright 1994 Speech Compression
  36.                               All Rights Reserved
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                             U S E R    M A N U A L
  48.  
  49.  
  50.  
  51.                                    June 1994
  52.  
  53. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  i
  54. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  55.  
  56.  
  57.                                    CONTENTS
  58.  
  59.  
  60. INTRODUCTION .......................................................... 1
  61.  
  62. THE UTILITIES ......................................................... 2
  63.  
  64.   SONARC.EXE .......................................................... 2
  65.  
  66.   SONARCX.EXE ......................................................... 5
  67.  
  68. LICENSING INFORMATION ................................................. 6
  69.  
  70. OTHER LICENSABLE MODULES .............................................. 7
  71.  
  72.   SONLIB.DLL .......................................................... 7
  73.  
  74.   LINKABLE OBJECTS .................................................... 9
  75.  
  76. POSTSCRIPT ........................................................... 11
  77.  
  78.  
  79.  
  80.  
  81.                                LEGAL MUMBO-JUMBO
  82.                                       AND
  83.                          ACKNOWLEDGMENT OF TRADEMARKS
  84.  
  85. Even though Speech Compression has tested the Sonarc software and reviewed
  86. the documentation, SPEECH COMPRESSION MAKES NO WARRANTY OR REPRESENTATION,
  87. EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO SONARC SOFTWARE, ITS QUALITY,
  88. PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.  AS A
  89. RESULT, THIS SOFTWARE IS PROVIDED "AS IS", AND YOU, THE USER, ARE ASSUMING
  90. THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE.
  91.  
  92. IN NO EVENT WILL SPEECH COMPRESSION BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
  93. INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN SONARC
  94. SOFTWARE OR ITS DOCUMENTATION, even if advised of the possibility of such
  95. damages.  In particular, Speech Compression shall have no liability for any
  96. programs or data used with Sonarc software, including the cost of recovering
  97. such programs or data.
  98.  
  99.  
  100. Sonarc, Sonarcx and ZipTalk are trademarks of Speech Compression.
  101.  
  102. Microsoft and MS-DOS are registered trademarks and Windows is a trademark of
  103. Microsoft Corporation.
  104.  
  105. BORLAND is a registered trademark of Borland International, Inc.
  106.  
  107. PKZIP is a registered trademark of PKWARE Inc.
  108.  
  109. All other brand and product names mentioned are trademarks or registered
  110. trademarks of their respective holders.
  111.  
  112. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  1
  113. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  114.  
  115.                                  INTRODUCTION
  116.  
  117. Sonarc is a new compression technology specifically optimized for digital
  118. audio.  Think of Sonarc as the PKZIP(r) of digitized audio.  Unlike the older
  119. ADPCM techniques, Sonarc features variable-rate compression which can be
  120. reversed to precisely reconstruct the original, uncompressed signal.  You
  121. don't need to judge its quality by listening to the original and decompressed
  122. versions of the signal; just run MS-DOS's COMP or FC commands!
  123.  
  124. What's the average amount of compression achievable with Sonarc?  Obviously,
  125. truly random sequences of numbers (white noise) will not compress at all
  126. losslessly.  On the other hand, there are 8-bit, 22 KHz sound-effects files
  127. in products on the market today for which Sonarc achieves an average of 3:1
  128. lossless compression (see below).  It all depends upon the quality of the
  129. recording and sampling and on the nature of the audio signal being processed.
  130. The grand average compression of all 8-bit, 11 KHz WAVE and VOC files that
  131. have been processed so far by Sonarc is about 55% (over 2:1).
  132.  
  133. Sonarc was not intended to be a general-purpose data compression utility,
  134. like the other compressors to which it is compared below.  In fact, Sonarc
  135. does only a mediocre job of compression on files which contain non-audio data.
  136. The following comparison is not for the purpose of denigrating the other
  137. compression products, but simply to show how well Sonarc is adapted to the
  138. compression of audio data.  The four files used in this comparison are
  139. probably the most widely distributed audio files in the world, since they
  140. come with each copy of Microsoft's Windows v3.1.
  141.  
  142.     File      Original size     LHA v2.13     PKZIP v2.04g   Sonarc v2.1h
  143. ───────────────────────────────────────────────────────────────────────────
  144.   CHIMES.WAV     15,920           8,680          8,690          4,170
  145.   CHORD.WAV      24,982           9,407          8,861          7,174
  146.   DING.WAV       11,598           4,704          4,630          2,184
  147.   TADA.WAV       27,804          18,388         18,566         11,528
  148.                  ──────          ──────         ──────         ──────
  149.                  80,304          41,179         40,747         25,056
  150.  
  151. The command-line option -ex (Maximum Compression) was used with PKZIP.
  152. Sonarc used the command-line options -o0 and -x for maximum compression.
  153.  
  154. The compressed file sizes reported for LHA and PKZIP are the internal file
  155. sizes and do not include the archive directory overhead.
  156.  
  157. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  2
  158. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  159.  
  160.                                  THE UTILITIES
  161.  
  162. Compression and decompression are accomplished using the programs SONARC.EXE
  163. and SONARCX.EXE, respectively.
  164.  
  165. Both programs use a simple command-line interface.  Typing SONARC or SONARCX
  166. alone at the DOS prompt will cause the program to display a little "help"
  167. screen, explaining the syntax of the command line parameters.
  168.  
  169. Monaural and stereo, 8-bit and 16-bit files are supported in both WAVE and VOC
  170. formats.  Creative Labs' new v1.20 VOC files are fully supported.
  171.  
  172. Neither utility uses extended or EMS memory.  Both use less than 256K of
  173. conventional memory.
  174.  
  175. Both utilities run on 8086 processors; however, when processing 16-bit data,
  176. they "sense" whether they are executing on a '386 or better, and if so, will
  177. use the '386 instruction set for faster execution.
  178.  
  179. SONARC.EXE (file-to-file compression program)
  180. ───────────────────────────────────────────────────────────────────────────
  181.  
  182. The syntax for invoking SONARC is:
  183.  
  184.         SONARC {-<option>} <input-file> [<output-file>]
  185. or
  186.         SONARC {-<option>} <wildcarded-name> [<dest-path>]
  187.  
  188. If the input file has an extension, then it must be supplied.  If the input
  189. file is not in the current directory, then the path needed to reach it from
  190. the current directory is also required.
  191.  
  192. The output file specification is optional.  If it is omitted, then the output
  193. file will be created in the current directory with a name which is formed by
  194. concatenating the root name in the input file with one of the extensions
  195. shown below.  If it is supplied, then a path can be specified to cause the
  196. output file to be written to a directory other than the current directory.
  197. If no extension is specified for the output file, the extension will be WV,
  198. VC, or SNC, depending on whether the input file is in WAVE, VOC, or another
  199. format, respectively.  (SONARC scans the beginning of the file for a WAVE or
  200. VOC header.  If it finds neither, it assumes the file is "raw", i.e., contains
  201. only audio samples; it then prepends its own header to the output file.)
  202.  
  203. Alternatively, a wild-card specification (with source path, if needed) can be
  204. used.  If a destination path is supplied, the output files will be written to
  205. that path, otherwise to the current directory.  Any destination name or
  206. extension will be ignored.
  207.  
  208. If the input file to Sonarc is a WAVE file, then the output file is also a
  209. WAVE file in a special, proprietary format which has been registered with
  210. Microsoft's Multimedia Product Management.
  211.  
  212. Although the letter options are shown on the next page in upper case, they can
  213. be entered in either upper or lower case.  The option prefix character may be
  214. either a '-' or '/'.
  215.  
  216. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  3
  217. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  218.  
  219. The command-line options for SONARC.EXE are:
  220.  
  221.         Q        quiet mode: no banners, no statistics, no warning for
  222.                  overwriting existing files.
  223.  
  224.         D        delete the input file upon successful operation.
  225.  
  226.         S[n]     (used with "raw" files) assume stereo (two interleaved
  227.                  tracks, or "n" interleaved tracks if the optional number "n"
  228.                  is specified).  The default is to assume that the "raw" file
  229.                  is monaural.
  230.  
  231.         16       assume 16-bit samples, if the input file is "raw". 
  232.                  The default for "raw" files is to assume that they 
  233.                  are all 8-bit samples.  Options S and 16 may be 
  234.                  used together to compress "raw" 16-bit, stereo 
  235.                  files.
  236.  
  237.         Fnum     set the frame size to num in the range 256-4096.  Sonarc
  238.                  divides the source into "frames" of so many samples each.
  239.                  The compressed file then consists of compressed "frames",
  240.                  each of which contains table data specific for that frame.
  241.                  If the frame size is too small, then the size of the table
  242.                  data will not be amortized over enough compressed samples
  243.                  and the compression ratio will suffer.  If the frame size is
  244.                  too big, then spectral changes within the frame will not be
  245.                  tracked accurately enough, and so the compression ratio will
  246.                  suffer for that reason.  Different files will have different
  247.                  "optimal" values for frame size.  This option overrides the
  248.                  default frame size of 2048.
  249.  
  250.         Onum     set order to num in the range from 0 to 30.  "Order" is
  251.                  the number of previous samples to take into consideration
  252.                  when attempting to predict the next sample.  This option
  253.                  fixes the order to the number specified, except that a num
  254.                  of 0 causes the program to "search" for the best value of
  255.                  order for each frame.  This added searching will slow the
  256.                  compression process substantially, but generally yields more
  257.                  compression.  The default order is 10.
  258.  
  259.         X        use floating-point calculations to analyze the signal more
  260.                  thoroughy than is otherwise done (the default is to use fixed-
  261.                  point integer arithmetic).  Setting this option will slow the
  262.                  compression process moderately, or immoderately if combined
  263.                  with the -o0 option described above.  The floating-point code
  264.                  uses a "sensing" library that uses a co-processor if detected
  265.                  at run-time.  A co-processor is not necessary, but is highly
  266.                  recommended nevertheless for the sake of compression speed.
  267.  
  268. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  4
  269. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  270.  
  271. Examples:
  272.  
  273.     SONARC C:\WIN31\*.WAV
  274.         Compress all the .WAV files in the C:\WIN31 directory and write the
  275.         output to the current directory
  276.  
  277.     SONARC /D ILBEBACK.WAV ..
  278.         Compress ilbeback.wav in the current directory to ilbeback.wv, in the
  279.         parent directory.  Erase ilbeback.wav if no errors occur.
  280.  
  281.     sonarc -q *.voc d:
  282.         Compress all the .VOC files in the current directory and write the
  283.         corresponding .VC files to the current directory of the D: drive.
  284.         Suppress all screen output.
  285.  
  286.     sonarc piano.sou pno
  287.         (assuming piano.sou is "raw":) Compress piano.sou to pno.snc
  288.  
  289.     sonarc -s piano.sou pno.cmp
  290.         Compress piano.sou to pno.cmp; assume the samples are interleaved
  291.         stereo tracks
  292.  
  293.     sonarc -16 piano.sou pno.
  294.         Compress piano.sou to pno; assume piano.sou is sampled at 16 bits
  295.  
  296.     sonarc -x -o0 g145.wav
  297.         Compress g145.wav for maximum compression ratio, at the expense of
  298.         considerable extra time in compressing the file
  299.  
  300. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  5
  301. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  302.  
  303. SONARCX.EXE (file-to-file decompression program)
  304. ───────────────────────────────────────────────────────────────────────────
  305.  
  306. The syntax for invoking SONARCX is:
  307.  
  308.         SONARCX {-<option>} <input-file> [<output-file>]
  309. or
  310.         SONARCX {-<option>} <wildcarded-name> [<dest-path>]
  311.  
  312. The input (compressed) file specification requires the file's extension, if
  313. any.  (This will be the extension specified for the output file during the
  314. execution of SONARC, or else WV, VC, or SNC, if no extension was specified.)
  315.  
  316. If the input file is not in the current directory, then the path needed to
  317. reach the file from the current directory is also required.
  318.  
  319. The output (decompressed) file specification is optional.  If it is omitted,
  320. then the output file will be created in the current directory with a name
  321. which is formed by concatenating the root name in the input file with one of
  322. extensions described below.  If it is supplied, then a path can be specified
  323. to cause the output file to be written to a directory other than the current
  324. directory.  If no extension is specified for the output file, the extension
  325. will be WAV, VOC, or the original file's extension in the case where the
  326. original file was not in either WAVE or VOC format.
  327.  
  328. Alternatively, a wild-card specification (with source path, if needed) can
  329. be used for specifying the input (compressed) files.  If a destination path
  330. is supplied, then the output (decompressed) files will be written to that
  331. path, otherwise to the current directory.  Any destination name or extension
  332. will be ignored.
  333.  
  334. Since Sonarc is a LOSSLESS compression technology, the decompressed and
  335. original files will differ only in their timestamps.  They will otherwise
  336. compare identically, using the FC or COMP commands in DOS.
  337.  
  338. The command-line options for SONARCX.EXE are:
  339.  
  340.         Q      quiet mode: no banners, no statistics, no warning for 
  341.                overwriting existing files.
  342.  
  343.         D      delete the input file upon successful operation.
  344.  
  345. Examples:
  346.  
  347.     SONARCX *.WV
  348.         Decompress all the .WV files in the current directory and write the
  349.         reconstructed files to the current directory
  350.  
  351.     sonarcx -q *.vc d:\
  352.         Decompress all the .VC files in the current directory and write the
  353.         corresponding .VOC files to the root directory of the D: drive.
  354.         Suppress all screen output.
  355.  
  356.     sonarcx pno.snc piano
  357.         Decompress pno.snc to piano.sou (if "sou" was the extension on the
  358.         original file, stored in the pno.snc file header).
  359.  
  360. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  6
  361. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  362.  
  363.                              LICENSING INFORMATION
  364.  
  365. What you may do with Sonarc depends on what classification you fall under.
  366. The archive referred to is the SNRC21.ZIP file from which this file was
  367. extracted.
  368.  
  369. 1. Shareware distributors, computer clubs and user groups:
  370.  
  371.   Members of this category are permitted to distribute this archive along with
  372.   other shareware programs as long as the charge for the diskette containing
  373.   this archive does not exceed US$10.
  374.  
  375. 2. Bulletin-board services:
  376.  
  377.   You may post this archive freely for the downloading convenience of your
  378.   customers.
  379.   
  380.   You may add a comment to the archive promoting your BBS.  Please inform me
  381.   if you do this.
  382.  
  383.   You may use Sonarc to compress any sound files in your possession and offer
  384.   the Sonarc-compressed files for downloading by your customers as long as
  385.   doing so does not violate any copyrights.  Please inform me if you do this.
  386.  
  387. 3. All other organizations (for-profit, not-for-profit, or governmental):
  388.  
  389.   After an evaluation period not to exceed 120 days, your organization must
  390.   either license the software from Speech Compression or destroy all copies
  391.   in its possession.
  392.  
  393.   For its internal use only, the organization must obtain a Site License.
  394.   For use in distributed products, the organization must obtain a Distribution
  395.   License.  These are available from the contact address below.
  396.  
  397. 4. Individuals (not including fictitious persons, such as corporations):
  398.  
  399.   You may use Sonarc in any way you want for as long as you want, as long as
  400.   it's not-for-profit.  This software is being distributed as shareware, i.e.,
  401.   "try before you buy."
  402.  
  403.   You may make copies of this archive and distribute it freely or upload it
  404.   to BBS's.  You are required to keep the component files of this archive
  405.   together, unmodified.
  406.  
  407.   You are cordially invited to send in a registration fee of $20 if you find
  408.   this software useful.  In exchange, you will receive one free upgrade of the
  409.   next version of Sonarc (v2.2 with a "lossy" algorithm) when it becomes
  410.   available.  You will also get the satisfaction of paying for value received.
  411.  
  412.   Please send your check made out to "Speech Compression", along with your
  413.   name and address (if not already imprinted on the check), to:
  414.  
  415.                              Speech Compression
  416.                              1910 W. Pawnee Lane
  417.                              Colbert, WA  99005-9401
  418.  
  419. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  7
  420. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  421.  
  422.                      OTHER LICENSABLE MODULES: SONLIB.DLL
  423.  
  424. A DLL version of the SONARCX.EXE utility is also available for licensing.
  425. This DLL is useful for applications which install under Windows and use lots
  426. of WAVE files.  It is described in detail below.  It is available for
  427. licensing by contacting Speech Compression at the address on the previous
  428. page.
  429.  
  430. The SONLIB.DLL library has just a single callable function at index 1.  The "C"
  431. calling interface is as follows:
  432.  
  433.     extern int far pascal sonarcx(char* infyl,
  434.                                   char* outfyl,
  435.                                   int   EraseInputFile,
  436.                                   int   ShowNames);
  437.  
  438. or, in Pascal,
  439.  
  440.     function sonarcx(infyl, outfyl: pchar;
  441.                      EraseInputFile,
  442.                      ShowNames: Boolean): integer; far; external;
  443.  
  444. The type "pchar" is a Borland extension to Pascal which is a pointer to a 
  445. C-style, null-terminated string.
  446.  
  447. The first argument, infyl, may be wildcarded, in which case the second 
  448. argument, outfyl, should be the empty string '' or a destination path.  The
  449. third argument, EraseInputFile, has the same effect as the "-D" option in the
  450. SONARCX utility, that is, it causes the input file to be erased after
  451. successful completion.
  452.  
  453. The fourth argument, ShowNames, has the inverse effect of the "-Q" option in
  454. SONARCX.  If false, no screen I/O occurs whatsoever.  If true, however, it
  455. writes the name of the file currently being decompressed in an area of the DLL
  456. caller's active window.
  457.  
  458. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  8
  459. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  460.  
  461.                  OTHER LICENSABLE MODULES: SONLIB.DLL (cont.)
  462.  
  463. The function result is 0 if there were no errors detected.  The following are
  464. the error codes and conditions that may be returned:
  465.  
  466. -17      16-bit file encounted by a DLL configured to process only 8-bits.
  467. -16      .WV file was produced by a later version of Sonarc than v2.1.
  468. -15      specify output file name different from input file name.
  469. -14      bad block type in .VC file.
  470. -13      corrupted VC format file header.
  471. -12      input file is not a Sonarc-compressed file.
  472. -11      input file is an uncompressed VOC file.
  473. -10      internal error: corrupted frame data.
  474.  -9      version mismatch: compressed VOC file is obsolete version.
  475.  -8      unknown chunk type in data list.
  476.  -7      internal error: mismatch in sample count.
  477.  -6      missing "fact" chunk.
  478.  -5      "fact" chunk has corrupted length field.
  479.  -3      WAVE file is already in uncompressed format.
  480.  -2      WAVE file already compressed using another vendorÆs process.
  481.  -1      internal error: bad frame checksum (corrupted frame).
  482.   2      File not found.
  483.   3      Non-existent drive, sub-directory or badly formed file name.
  484.   5      Name is directory or existing read-only file.
  485. 100      Attempt to read past end of file: probably corrupted sound file.
  486. 101      Disk full.
  487. 150      Disk is write-protected.
  488. 152      Drive not ready.
  489. 162      Hardware failure.
  490.  
  491. Other error codes may be returned from DOS for various I/O operations.
  492.  
  493. SONARC version 2.1h    Copyright 1994 Speech Compression              Page  9
  494. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  495.  
  496.                   OTHER LICENSABLE MODULES: LINKABLE OBJECTS
  497.  
  498. There are also assembly-coded buffer-to-buffer compression and decompression
  499. routines available which are highly optimized for both space and speed.  The
  500. interfaces for these routines are described in detail below.
  501.  
  502. Organizations wishing to obtain copies of these linkable modules must contact
  503. Speech Compression at the address on page 6.
  504.  
  505. The "C" declarations for the 8- and 16-bit compression routines are:
  506.  
  507.     typedef unsigned char[max_buf_len]* p_bytary;
  508.  
  509.     extern int far pascal cmp8(p_bytary p_input,
  510.                                int in_size,
  511.                                p_bytary p_output,
  512.                                int out_max,
  513.                                int order);
  514.  
  515.     typedef int[max_buf_len]* p_intary;
  516.  
  517.     extern int far pascal cmp16(p_intary p_input,
  518.                                 int in_size,
  519.                                 p_intary
  520.                                 p_output,
  521.                                 int out_max,
  522.                                 int order);
  523.  
  524. The corresponding Pascal declarations are:
  525.  
  526.     type bytary = array [0..max_buf_len-1] of char;
  527.          p_bytary = ^bytary;
  528.  
  529.     function cmp8(p_input: p_bytary;
  530.                   in_size: integer;
  531.                   p_output: p_bytary;
  532.                   out_max, order: integer;
  533.                  ): integer; far; external;
  534.  
  535.     type intary = array [0..max_buf_len-1] of integer;
  536.          p_intary = ^intary;
  537.  
  538.     function cmp16(p_input: p_intary;
  539.                    in_size: integer;
  540.                    p_output: p_intary;
  541.                    out_max, order: integer;
  542.                   ): integer; far; external;
  543.  
  544. Both cmp8 and cmp16 take a buffer of order+in_size samples at p_input and
  545. compress the in_size samples beginning at p_input[order] into the output buffer
  546. at p_output, not to exceed out_max bytes.  Note that for cmp16, the size of the
  547. input buffer is 2*(order+in_size) bytes, since each sample is 2 bytes. Both
  548. p_input and p_output are far, i.e., 32-bit, segmented pointers.  The argument
  549. out_max is the size of the output buffer into which the compressed frame is
  550. copied.  Note that this is not the size of the compressed frame; that
  551. information is stored into the first 16-bit word of the frame itself.  The
  552. argument out_max is passed to the routine to prevent it from producing a frame
  553. larger than the output buffer whose address is passed in.
  554.  
  555. SONARC version 2.1h    Copyright 1994 Speech Compression              Page 10
  556. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  557.  
  558. The function result is returned in the AX register, where most "C" and Pascal
  559. compilers expect it.  The result value is zero for normal, error-free
  560. processing.
  561.  
  562. Two error conditions are possible.  If insufficient stack space is allocated, a
  563. result of -2 is returned.  This occurs if the SP register is less than 
  564. approximately 2*order+184 at the time of the call to cmp8, or less than
  565. 2*order+364 at the time of the call to cmp16.  (Note: This is a change from
  566. prior versions where enough stack space had to be allocated to copy the entire
  567. input buffer.)
  568.  
  569. The second error condition occurs when the number of bytes of output buffer
  570. needed for the compressed input buffer exceeds the value of out_max, in which
  571. case a result value of -1 is returned.
  572.  
  573. ───────────────────────────────────────────────────────────────────────────
  574.  
  575. The "C" declarations for the 8- and 16-bit decompression routines are:
  576.  
  577.     extern int far pascal dcmp8(p_bytary p_input,
  578.                                 p_bytary p_output);
  579.  
  580.     extern int far pascal dcmp16(p_intary p_input,
  581.                                  p_intary p_output);
  582.  
  583. The corresponding Pascal declarations are:
  584.  
  585.     function dcmp8(p_input,
  586.                    p_output: p_bytary
  587.                   ): integer; far; external;
  588.  
  589.     function dcmp16(p_input,
  590.                     p_output: p_intary
  591.                    ): integer; far; external;
  592.  
  593. Both dcmp8 and dcmp16 take a compressed frame at p_input and decompress it into
  594. the output buffer starting at p_output[order].  The decompression routine gets
  595. the order datum from the byte at offset 7 in the input v2.1 compressed frame
  596. (see the frame header description in the File and Frame Formats section).  As
  597. previously explained, the header of the compressed frame contains, at fixed
  598. offsets, the lengths needed by the caller and the decompression routine to
  599. figure out how much buffer space to allocate and use, respectively.
  600.  
  601. As is the case for the compression routines, the function result is returned in
  602. the AX register.  The result value is zero for normal, error-free processing. 
  603. The only error condition, resulting in a returned value of -1, is if the
  604. checksum fails.  If this error occurs, it means that the input frame has been
  605. folded, spindled, and/or mutilated at some point following its creation by the
  606. compression routine.  Keep in mind that the entire frame must be passed to the
  607. decompression routine; partial frames cannot be decompressed.
  608.  
  609. Note that stack overflow is not checked for in the decompression modules.
  610. However, the stack space required by these routines is guaranteed to be less
  611. than 50 bytes.
  612.  
  613. The DS, SS, CS, BP, SI and DI registers are preserved by these routines.  No
  614. instructions unique to the '186, '286, '386, or '486 processors are used in the
  615. 8-bit modules.  The 16-bit modules, however, make use of the '386 instruction
  616. family whenever they "sense" that they are running on a '386 or better.
  617.  
  618. SONARC version 2.1h    Copyright 1994 Speech Compression              Page 11
  619. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  620.  
  621.                                   POSTSCRIPT
  622.  
  623. I picked the d.b.a. "Speech Compression" in 1992, when I started working on a
  624. technology for PCs capable of compressing speech signals lossily at ratios of
  625. over 10:1.  Currently no compression is available for speech at such ratios
  626. (of any quality, that is) that does not require either huge run-time tables
  627. (>100 Kbytes), or some sort of special hardware support, such as a DSP chip.
  628.  
  629. I got ZipTalk (as I called it) developed to the point where I could prove to
  630. myself that decompression of speech signals could be accomplished on an 8088
  631. processor running at 4.77 MHertz with processor to spare, using tables of
  632. probably not much more than 16K bytes.
  633.  
  634. The compression side is a complex, but solved, problem since it piggy-backs
  635. off of linear-predictive analysis.  In fact, the whole trick is to transform
  636. frequency-domain parameters obtained through LPC techniques into a special
  637. format that I have discovered, which then permits real-time conversion back
  638. into time-domain signals.  (I can say it faster than I can develop it!)
  639.  
  640. However, while waiting for some research documents to arrive by USnail, I was
  641. put in contact with a company which needed lossless audio compression, and I
  642. diverted my energy to the development of Sonarc.  (If you need Sonarc to be
  643. an acronym of something, and you don't like "SOuNd ARChival" then I suppose
  644. it could be "Some Outfit Nagged About Reversible Compression".)
  645.  
  646. I've spent a considerable amount of time researching various ways of doing
  647. "lossy" audio compression.  Earlier versions of Sonarc featured a "lossy"
  648. parameter -Ln[n], which achieved higher compression ratios while keeping the
  649. total amplitude distortion in the decompressed signal less than n.[n]%.
  650. Unfortunately, the compression phase was extremely compute-intensive and
  651. generally required overnight runs to compress any significant amount of audio
  652. files.  I've never tried combining this "lossy" with the -x and -o0 options;
  653. I suspect there would be a measurable amount of proton decay before it could
  654. finish.  I only left it out of this shareware version because it is so slow,
  655. and I didn't want that sullying Sonarc's otherwise fine reputation.  I'm still
  656. developing the "lossy" algorithm, though, and I'll have a "lossy" solution in
  657. the v2.2.  Don't ask me when; it'll be ready when it's ready.
  658.  
  659. I suppose, in retrospect, I might have called myself "Sound Compression" or
  660. some such (not being particularly imaginative in the naming department).  But
  661. I'm stuck with "Speech Compression", even though I now do general audio
  662. compression, and may later branch out into image compression as well.  (Most
  663. algorithms which process 1-D signals can, in principle, be extended to process
  664. 2-D signals.)
  665.  
  666. Send feedback to 76635,3652@compuserve.com.
  667.  
  668.                              Richard P. Sprague
  669.  
  670.